home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_12751.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  33 lines

  1. -- card: 12751 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10.     struct Person:indirect
  11.  
  12. In C, the keyword 'struct' is used to define a new type of DATA STRUCTURE of the programmer's choice.  That is, a variable defined with this new type can represent a collection (record) of integer, character, and floating-point variables, called                  "members".  This collection is described in a list enclosed by {} braces.
  13.  
  14. TC and C++ extend this idea so that the data structure may be a CLASS.  Objects defined with this type represent a collection of instance variables AND the methods - or             "member functions" - which may act upon them.  In this case, when an object of type Person is defined later in the program, space will be allocated for two integer variables which may be accessed by sending set and print messages to the object.
  15.  
  16. The word 'indirect' is unique to TC, and specifies how TC should implement objects of this type.  (The other - less frequently used - option is 'direct'.)  The significance of this implementation will be discussed later*.
  17.  
  18.  
  19. -- part contents for background part 27
  20. ----- text -----
  21. Macintosh memory management
  22.  
  23. -- part contents for background part 20
  24. ----- text -----
  25. Macintosh memory management - p123
  26.  
  27. -- part contents for background part 7
  28. ----- text -----
  29. 21
  30.  
  31. -- part contents for background part 29
  32. ----- text -----
  33. 38494